<%@page contentType="text/html; charset=utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Mail Setup</title>
<link href="<s:url value="/css/admin.css"/>

" rel="stylesheet" type="text/css">
<s:head/>
</head>
<script language="javascript">
	function addAddress(target,address,name)
	{
		if(address.value=='')
		{
			alert('Please input address.');
			address.focus();
			return;
		}
		var tr = document.createElement('tr');
		target.appendChild(tr);
		var td  = document.createElement('td');
		td.innerHTML=address.value+'<input type="hidden" name="'+name+'" value="'+address.value+'">'+
					'&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="'+target.id+'.removeChild(this.parentNode.parentNode)">删除</a>';
		tr.appendChild(td);
		address.value='';
	}
</script>
<body>
<br>
<s:form action="setemailconfig" method="post" name="frm">
<center>
  <strong> Mail Setup
  </strong>
</center>
<br>
<center><s:actionmessage/> <s:actionerror/></center>
<table width="83%" height="282"  border="1" align="center" cellpadding="0" cellspacing="0" style="border-collapse:collapse ">
  <tr>
    <td width="23%" height="25" align="right"><strong>Cc:</strong></td>
    <td width="46%">
	<table width="90%"  border="0" cellpadding="0" cellspacing="0">
	<tbody id="ccBody">
	 <s:iterator value="cc" status="i">
	  <tr>
		<td>
		<s:property value="%{cc.get(#i.index)}"/><input type="hidden" value="<s:property value="%{cc.get(#i.index)}"/>" name="cc">&nbsp;&nbsp;&nbsp;
		<a href="javascript:void(0)" onclick="ccBody.removeChild(this.parentNode.parentNode)">Delete</a></td>
	  </tr>
	 </s:iterator>
	</tbody>
	</table>
	<input type="text" name="ccInput"><input type="button" value="Add" onClick="addAddress(ccBody,frm.ccInput,'cc')">
	</td>
    <td width="31%">The Cc address</td>
  </tr>
  <tr>
    <td height="25" align="right"><strong>Bcc:</strong></td>
    <td>
		<table width="90%"  border="0" cellpadding="0" cellspacing="0">
		<tbody id="bccBody">
		 <s:iterator value="bcc" status="i">
		  <tr>
			<td>
			<s:property value="%{bcc.get(#i.index)}"/><input type="hidden" value="<s:property value="%{bcc.get(#i.index)}"/>" name="bcc">&nbsp;&nbsp;&nbsp;
			<a href="javascript:void(0)" onclick="bccBody.removeChild(this.parentNode.parentNode)">Delete</a></td>
		  </tr>
		 </s:iterator>
		</tbody>
		</table>
		<input type="text" name="bccInput"><input type="button" value="Add" onClick="addAddress(bccBody,frm.bccInput,'bcc')">
	</td>
    <td>The Bcc address</td>
  </tr>
  <tr>
    <td height="25" align="right"><strong>Host:</strong></td>
    <td><s:textfield name="host"/> </td>
    <td>Host Address</td>
  </tr>
  <tr>
    <td height="25" align="right"><strong>Username:</strong></td>
    <td><s:textfield name="username"/> </td>
    <td>Username for email</td>
  </tr>
  <tr>
    <td height="25" align="right"><strong>Password:</strong></td>
    <td><s:password name="defaultPassword" showPassword="true" onfocus="this.select();"/> </td>
    <td>Password for email</td>
  </tr>
  <tr>
    <td height="25" align="right"><strong>Poster</strong></td>
    <td><s:textfield name="from"/> </td>
    <td>Ower of this email</td>
  </tr>
</table>
<br>
<table width="61%"  border="00" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><input type="button" name="Submit" value=" Submit " onClick="if(confirm('Are you sure to modify the email setup?'))frm.submit();">&nbsp;&nbsp;&nbsp;
    <input type="button" name="Submit2" value=" Reset " onClick="frm.reset();"></td>
  </tr>
</table>
</s:form>
</body>
</html>
